#!/usr/bin/env python3
# -*- encoding:utf-8 -*-

import argparse

parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(title='subcommands', dest='subcommand')

# create the parser for the "a" command
parser_a = subparsers.add_parser('a', help='subcommand a')
parser_a.add_argument('-x', type=int, default=0, help='x argument')

# create the parser for the "b" command
parser_b = subparsers.add_parser('b', help='subcommand b')
parser_b.add_argument('-y', type=int, default=0, help='y argument')

# parse an argument
args = parser.parse_args()

if args.subcommand == 'a':
    print(args.x)
elif args.subcommand == 'b':
    print(args.y)
